import request from "../../utils/request";
import {
  loginForm,
  loginResponseForm,
  logoutResponseForm,
  userInfoResponseForm,
} from "./type";

enum API {
  LOGIN_URL = "/admin/acl/index/login",
  USERINFO_URL = "/admin/acl/index/info",
  LOGOUT_URL = "/admin/acl/index/logout",
}

export const reqLogin = (data: loginForm) =>
  request.post<any, loginResponseForm>(API.LOGIN_URL, data);

export const reqUserInfo = () =>
  request.get<any, userInfoResponseForm>(API.USERINFO_URL);

export const reqLogout = () =>
  request.post<any, logoutResponseForm>(API.LOGOUT_URL);
